﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Xyz.BusinessObjects;
using Xyz.DataObjects.Interfaces;

namespace Xyz.DataObjects.Entity.Dao
{
    public class EntityPaymentMethodDao : IPaymentMethodDao
    {
        public List<PaymentMethod> GetPaymentMethods()
        {
            using (var context = EntityObjectFactory.CreateContext())
            {
                var paymentMethods = new List<PaymentMethod>();
                var query = context.PaymentMethodEntities.AsQueryable().ToList();

                query.ForEach(x => paymentMethods.Add(Mapper.Map(x)));

                return paymentMethods;
            }
        }
    }
}
